package org.zn.mvcbase.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

//@WebListener
@Deprecated
public class ContextPathListener implements ServletContextListener{

	private Logger log=LoggerFactory.getLogger(ContextPathListener.class);
	
	@Override
	public void contextDestroyed(ServletContextEvent contextEvent) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void contextInitialized(ServletContextEvent contextEvent) {
		// TODO Auto-generated method stub
		
		ServletContext servletContext = contextEvent.getServletContext();
		
		log.info("CtxListener start");
		log.info("cpath :"+servletContext.getContextPath());
		
		servletContext.setAttribute("cpath", servletContext.getContextPath());
	}

}
